(function(){
	let Background = window.Background = function(){
		this.w = 218;
		this.h = 512;
		this.x = 0;
		this.speed = 3;
		this.init();
	}
	
	Background.prototype.init = function(){
		//放置原背景底图
		game.ctx.drawImage(game.R.bg_day,this.x,(game.canvas.height - this.h) * 0.75);
		game.ctx.drawImage(game.R.bg_day,this.x + this.w,(game.canvas.height - this.h) * 0.75);
		game.ctx.drawImage(game.R.bg_day,this.x + this.w * 2,(game.canvas.height - this.h) * 0.75);
		//填充天空底色
		game.ctx.fillStyle = 'rgb(78,192,202)';
		game.ctx.fillRect(0,0,game.canvas.width,(game.canvas.height - this.h) * 0.75 + 10);
		//填充大地底色
		game.ctx.fillStyle = 'rgb(94,226,112)';
		game.ctx.fillRect(0,game.canvas.height * 0.75 + this.h * 0.25 -5,game.canvas.width,(game.canvas.height - this.h) * 0.25 + 5);
	}
	
	Background.prototype.move = function(){
		this.x -= this.speed;
		if(this.x < -this.w) this.x = 0;
	}
})();